import cv2
import numpy as np

img = np.zeros((512,512,3), np.uint8)
cv2.line(img, (0, 0), (511, 511), (255, 0,0), 5)
cv2.rectangle(img, (10, 20), (500, 400), (0, 255, 0), 5)


cv2.imshow("img", img)


cv2.waitKey(0)
cv2.destroyAllWindows()